//
//  HNSH_InviteFriendsCell.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/28.
//

#import "HNSH_InviteFriendsCell.h"
#import "HNSH_InviteFriendsCellInfoView.h"

@interface HNSH_InviteFriendsCell ()

/* imgV */
@property (nonatomic, strong) UIImageView *imgV;

/* infoView */
@property (nonatomic, strong) HNSH_InviteFriendsCellInfoView *infoView;
@end

@implementation HNSH_InviteFriendsCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = [UIColor appBGColor];
        [self configUI];
    }
    return self;
}

- (void)setModel:(HNSH_InviteFriendsModel *)model {
    _model = model;
    self.infoView.model = model;
}

- (void)setImgString:(NSString *)imgString {
    _imgString = imgString;
    [self.imgV sd_setImageWithURL:[NSURL URLWithString:imgString]];
}

- (void)configUI {
    self.imgV = [[UIImageView alloc]init];
    self.imgV.contentMode = UIViewContentModeScaleAspectFill;
    [self.contentView addSubview:self.imgV];
    self.imgV.clipsToBounds = YES;
    [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.bottom.mas_equalTo(0);
    }];
    
    [self.contentView addSubview:self.infoView];
    [self.infoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(28);
        make.right.mas_equalTo(-28);
        make.bottom.mas_equalTo(-10);
        make.height.mas_equalTo(80);
    }];
}

- (HNSH_InviteFriendsCellInfoView *)infoView {
    if (!_infoView) {
        _infoView = [[HNSH_InviteFriendsCellInfoView alloc]init];
    }
    return _infoView;
}

@end
